/**
 * This file is part of XaMauLo 
 * File :                       SchemaXML.scala
 * Author's email :             laure.conte@gmail.com
 *                              sophie.couillez@gmail.com
 **/


package objects;

/**
  * This class representes the error which will be return if the XML files isn't correct 
 */

class Error (nameError : String,nameBalise:String){
  val nameErr : String =nameError;
  val nameBal : String=nameBalise;
  var ligne : int =0;
  var column : int=0;
  
  //match the 
  var descrErr=nameErr match {
  case "MissingElt" => "The element "+nameBalise+" is present in the XML file but not in the XSD";
  case "MissingSon" => "The son "+nameBalise+" is present in the XSD but not in the XML file";
  case "MissingAttr" => "The Attribut "+nameBalise+" is present in the XML file but not in the XSD";
  case "nbOccursSupp"=>"The element "+nameBalise+" appears too many time!";
  case "nbOccursInf"=>"The element "+nameBalise+" appears not enough time! ";
  case "NoNode"=>"No son's node was found !";
  case "PbSyntaxeXSD"=>"Error in the XSD file the element " + nameBalise + " has to be found in the element simpleContent or complexContent"
  } 
  var typeError= nameErr match {
  case "MissingElt" => "Missing Element";
  case "MissingSon" => "Missing Son";
  case "MissingAttr" => "Missing Attribut";
  case "nbOccursSupp"=>"Too much element" ;
  case "nbOccursInf"=>"Not enough element";
  case "NoNode"=>"Missing nodes";
  case "PbSyntaxeXSD" => "Syntax problem"
  }

}

